#include "GroupManager.h"
#include "Defines.hpp"

void GroupManager::AddCharacter(Character* aChar)
{
	m_pCurrGroup->Add(aChar);
}

void GroupManager::RegisterGroup(Group* group)
{
	m_mGroups.insert(std::make_pair(group->GetID(), group));
	m_pCurrGroup = group;

}

void GroupManager::RemoveGroup(int ID)
{
	assert(ID != m_pCurrGroup->GetID() && "Cannot Remove Current Group");

	NullDelete(m_mGroups[ID]);
	m_mGroups.erase(ID);
}

MemberList GroupManager::GetGroupMembers(int id)
{
	// If the character does not belong to an groups
	// return an empty list.
	if(id < 0)
		return MemberList(); 
	else
		return m_mGroups[id]->Members();
}